Skip to content

fix(backend,frontend): fix chat routing stability, citation quality, and OCR spacing#7

Merged
sylvanding merged 1 commit intomainfrom
feat/chat-routing-chain-rewrite
Mar 12, 2026
Merged

fix(backend,frontend): fix chat routing stability, citation quality, and OCR spacing#7
sylvanding merged 1 commit intomainfrom
feat/chat-routing-chain-rewrite

Conversation

@sylvanding
Copy link
Copy Markdown
Owner

Summary

  • Chat transport closure bug: refactored to ref-based transport that always reads latest KB selection
  • React Router remounting: added key="playground" to prevent component remount between routes
  • Thinking chain UX: deduplicate steps, emit complete event for auto-collapse with summary
  • Citation quality: prioritize Paper.title from DB, use full_context for excerpts
  • OCR spacing: set pdfplumber x_tolerance=1 to fix word concatenation
  • CUDA config: propagate CUDA_VISIBLE_DEVICES from .env to os.environ

Test Plan

  • KB selection passed correctly in chat requests
  • Sidebar history loads without page refresh
  • Thinking chain deduplicated and auto-collapses
  • Citation cards show correct titles
  • OCR output has proper word spacing
  • GPU selection works for tasks

…and OCR spacing

- Fix useChat transport closure: use ref-based transport so knowledge base
  selection is always up-to-date without recreating the Chat instance
- Fix React Router remounting: add key="playground" to preserve state across
  / and /chat/:id routes, use replaceState instead of navigate during streams
- Fix thinking chain duplicate steps: deduplicate by step name, emit
  "complete" event for auto-collapse with summary
- Fix citation titles: prioritize Paper.title from DB over RAG chunk metadata
- Fix citation excerpts: use full_context (adjacent chunks) instead of
  truncated text[:500], increase display limits to 400/800
- Fix OCR spacing: set pdfplumber x_tolerance=1 to prevent word concatenation
- Fix CUDA config: propagate CUDA_VISIBLE_DEVICES from .env to os.environ

Made-with: Cursor
@sylvanding sylvanding merged commit ae7a967 into main Mar 12, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant